package com.cskaoyan.shopping.converter;


import com.cskaoyan.shopping.dal.entitys.*;
import com.cskaoyan.shopping.dto.PanelContentDto;
import com.cskaoyan.shopping.dto.PanelContentItemDto;
import com.cskaoyan.shopping.dto.PanelDto;
import com.cskaoyan.shopping.dto.ProductCateDto;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;

import javax.xml.transform.Source;
import java.util.List;
import java.util.Set;


@Mapper(componentModel = "spring")
public interface ContentConverter {

    @Mappings({})
    PanelContentDto panelContent2Dto(PanelContent panelContent);

    @Mappings({})
    PanelContentDto panelContentItem2Dto(PanelContentItem panelContentItem);

    @Mappings({})
    PanelDto panel2Dto(Panel panel);

    @Mappings({})
    List<PanelContentDto> panelContents2Dto(List<PanelContent> panelContents);

    List<PanelContentItemDto> panelContentItem2Dto(List<PanelContentItem> panelContentItems);

    @Mappings({})
    List<PanelContentItem> panelContents2Item(List<PanelContent> panelContents);

    @Mappings({})
    Set<PanelDto> list2Set(List<Panel> lists);

    @Mappings({
            @Mapping(source = "icon", target = "iconUrl")
    })

    ProductCateDto itemCat2Dto(ItemCat itemCat);

    List<ProductCateDto> itemCats2Dto(List<ItemCat> itemCats);
}
